{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "fe12c203-e6a6-452c-a655-afb8a03a4ff5",
   "metadata": {},
   "source": [
    "Improved-LLM-Tutor"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "c1070317-3ed9-4659-abe3-828943230e03",
   "metadata": {},
   "outputs": [],
   "source": [
    "# Standard library imports\n",
    "import os\n",
    "import time\n",
    "import json\n",
    "from typing import Dict, List, Any, Optional, Union, Callable\n",
    "\n",
    "# Third-party imports\n",
    "from dotenv import load_dotenv\n",
    "from IPython.display import Markdown, display, HTML, update_display\n",
    "from openai import OpenAI\n",
    "import ollama\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "# Try to import rich, install if not available\n",
    "try:\n",
    "    from rich.console import Console\n",
    "    from rich.markdown import Markdown as RichMarkdown\n",
    "    from rich.panel import Panel\n",
    "except ImportError:\n",
    "    !pip install rich\n",
    "    from rich.console import Console\n",
    "    from rich.markdown import Markdown as RichMarkdown\n",
    "    from rich.panel import Panel\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "4a456906-915a-4bfd-bb9d-57e505c5093f",
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "# Constants\n",
    "MODEL_GPT = 'gpt-4o-mini'\n",
    "MODEL_LLAMA = 'llama3.2'\n",
    "DEFAULT_SYSTEM_PROMPT = \"You are a helpful technical tutor who answers questions about python code, software engineering, data science and LLMs\"\n",
    "\n",
    "# Set up environment\n",
    "load_dotenv()\n",
    "openai = OpenAI()\n",
    "console = Console()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "a8d7923c-5f28-4c30-8556-342d7c8497c1",
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "class LLMTutor:\n",
    "    \"\"\"\n",
    "    A class that provides tutoring functionality using multiple LLM models.\n",
    "    \"\"\"\n",
    "    \n",
    "    def __init__(self, \n",
    "                 system_prompt: str = DEFAULT_SYSTEM_PROMPT,\n",
    "                 gpt_model: str = MODEL_GPT,\n",
    "                 llama_model: str = MODEL_LLAMA):\n",
    "        \"\"\"\n",
    "        Initialize the LLM Tutor with specified models and system prompt.\n",
    "        \n",
    "        Args:\n",
    "            system_prompt: The system prompt to use for the LLMs\n",
    "            gpt_model: The OpenAI GPT model to use\n",
    "            llama_model: The Ollama model to use\n",
    "        \"\"\"\n",
    "        self.system_prompt = system_prompt\n",
    "        self.gpt_model = gpt_model\n",
    "        self.llama_model = llama_model\n",
    "        self.history: List[Dict[str, Any]] = []\n",
    "        self.response_times = {'gpt': [], 'llama': []}\n",
    "        \n",
    "    def format_question(self, question: str) -> str:\n",
    "        \"\"\"\n",
    "        Format the user's question with a standard prefix.\n",
    "        \n",
    "        Args:\n",
    "            question: The user's question\n",
    "            \n",
    "        Returns:\n",
    "            Formatted question with prefix\n",
    "        \"\"\"\n",
    "        return f\"Please give a detailed explanation to the following question: {question}\"\n",
    "    \n",
    "    def create_messages(self, question: str) -> List[Dict[str, str]]:\n",
    "        \"\"\"\n",
    "        Create the message structure for LLM API calls.\n",
    "        \n",
    "        Args:\n",
    "            question: The user's question\n",
    "            \n",
    "        Returns:\n",
    "            List of message dictionaries\n",
    "        \"\"\"\n",
    "        formatted_question = self.format_question(question)\n",
    "        return [\n",
    "            {\"role\": \"system\", \"content\": self.system_prompt},\n",
    "            {\"role\": \"user\", \"content\": formatted_question}\n",
    "        ]\n",
    "    \n",
    "    def get_gpt_response(self, \n",
    "                        question: str, \n",
    "                        stream: bool = True) -> str:\n",
    "        \"\"\"\n",
    "        Get a response from the GPT model.\n",
    "        \n",
    "        Args:\n",
    "            question: The user's question\n",
    "            stream: Whether to stream the response\n",
    "            \n",
    "        Returns:\n",
    "            The model's response as a string\n",
    "        \"\"\"\n",
    "        messages = self.create_messages(question)\n",
    "        start_time = time.time()\n",
    "        \n",
    "        try:\n",
    "            if stream:\n",
    "                return self._stream_gpt_response(messages)\n",
    "            else:\n",
    "                response = openai.chat.completions.create(\n",
    "                    model=self.gpt_model, \n",
    "                    messages=messages\n",
    "                )\n",
    "                elapsed = time.time() - start_time\n",
    "                self.response_times['gpt'].append(elapsed)\n",
    "                return response.choices[0].message.content\n",
    "        except Exception as e:\n",
    "            console.print(f\"[bold red]Error with GPT model:[/bold red] {str(e)}\")\n",
    "            return f\"Error: {str(e)}\"\n",
    "    \n",
    "    def _stream_gpt_response(self, messages: List[Dict[str, str]]) -> str:\n",
    "        \"\"\"\n",
    "        Stream a response from the GPT model.\n",
    "        \n",
    "        Args:\n",
    "            messages: The messages to send to the model\n",
    "            \n",
    "        Returns:\n",
    "            The complete response as a string\n",
    "        \"\"\"\n",
    "        start_time = time.time()\n",
    "        try:\n",
    "            stream = openai.chat.completions.create(\n",
    "                model=self.gpt_model, \n",
    "                messages=messages,\n",
    "                stream=True\n",
    "            )\n",
    "            \n",
    "            response = \"\"\n",
    "            display_handle = display(Markdown(\"\"), display_id=True)\n",
    "            \n",
    "            for chunk in stream:\n",
    "                delta_content = chunk.choices[0].delta.content or ''\n",
    "                response += delta_content\n",
    "                # Clean the response for display\n",
    "                clean_response = response.replace(\"```python\", \"```\").replace(\"```\", \"\")\n",
    "                update_display(Markdown(clean_response), display_id=display_handle.display_id)\n",
    "            \n",
    "            elapsed = time.time() - start_time\n",
    "            self.response_times['gpt'].append(elapsed)\n",
    "            return response\n",
    "        except Exception as e:\n",
    "            console.print(f\"[bold red]Error streaming GPT response:[/bold red] {str(e)}\")\n",
    "            return f\"Error: {str(e)}\"\n",
    "    \n",
    "    def get_llama_response(self, question: str) -> str:\n",
    "        \"\"\"\n",
    "        Get a response from the Llama model.\n",
    "        \n",
    "        Args:\n",
    "            question: The user's question\n",
    "            \n",
    "        Returns:\n",
    "            The model's response as a string\n",
    "        \"\"\"\n",
    "        messages = self.create_messages(question)\n",
    "        start_time = time.time()\n",
    "        \n",
    "        try:\n",
    "            response = ollama.chat(model=self.llama_model, messages=messages)\n",
    "            elapsed = time.time() - start_time\n",
    "            self.response_times['llama'].append(elapsed)\n",
    "            return response['message']['content']\n",
    "        except Exception as e:\n",
    "            console.print(f\"[bold red]Error with Llama model:[/bold red] {str(e)}\")\n",
    "            return f\"Error: {str(e)}\"\n",
    "    \n",
    "    def ask(self, question: str, models: List[str] = ['gpt', 'llama']) -> Dict[str, str]:\n",
    "        \"\"\"\n",
    "        Ask a question to one or more models.\n",
    "        \n",
    "        Args:\n",
    "            question: The user's question\n",
    "            models: List of models to query ('gpt', 'llama', or both)\n",
    "            \n",
    "        Returns:\n",
    "            Dictionary with model responses\n",
    "        \"\"\"\n",
    "        responses = {}\n",
    "        \n",
    "        # Store the question in history\n",
    "        self.history.append({\n",
    "            'question': question,\n",
    "            'timestamp': time.strftime('%Y-%m-%d %H:%M:%S'),\n",
    "            'responses': {}\n",
    "        })\n",
    "        \n",
    "        # Get responses from requested models\n",
    "        if 'gpt' in models:\n",
    "            console.print(Panel(f\"[bold blue]Getting response from {self.gpt_model}...[/bold blue]\"))\n",
    "            gpt_response = self.get_gpt_response(question)\n",
    "            responses['gpt'] = gpt_response\n",
    "            self.history[-1]['responses']['gpt'] = gpt_response\n",
    "            \n",
    "        if 'llama' in models:\n",
    "            console.print(Panel(f\"[bold green]Getting response from {self.llama_model}...[/bold green]\"))\n",
    "            llama_response = self.get_llama_response(question)\n",
    "            responses['llama'] = llama_response\n",
    "            self.history[-1]['responses']['llama'] = llama_response\n",
    "            display(Markdown(f\"## {self.llama_model} Response\\n{llama_response}\"))\n",
    "            \n",
    "        return responses\n",
    "    \n",
    "    def compare_responses(self, question: str = None) -> None:\n",
    "        \"\"\"\n",
    "        Compare responses from different models side by side.\n",
    "        \n",
    "        Args:\n",
    "            question: Optional specific question to compare responses for\n",
    "        \"\"\"\n",
    "        if question:\n",
    "            responses = self.ask(question)\n",
    "        else:\n",
    "            # Use the most recent question from history\n",
    "            if not self.history:\n",
    "                console.print(\"[bold red]No questions in history to compare[/bold red]\")\n",
    "                return\n",
    "            responses = self.history[-1]['responses']\n",
    "            question = self.history[-1]['question']\n",
    "        \n",
    "        # Create HTML for side-by-side comparison\n",
    "        html = f\"\"\"\n",
    "        <div style=\"display: flex; width: 100%;\">\n",
    "            <div style=\"flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 5px; margin-right: 10px;\">\n",
    "                <h3 style=\"color: #4285F4;\">{self.gpt_model}</h3>\n",
    "                <div style=\"white-space: pre-wrap;\">{responses.get('gpt', 'No response')}</div>\n",
    "            </div>\n",
    "            <div style=\"flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 5px;\">\n",
    "                <h3 style=\"color: #34A853;\">{self.llama_model}</h3>\n",
    "                <div style=\"white-space: pre-wrap;\">{responses.get('llama', 'No response')}</div>\n",
    "            </div>\n",
    "        </div>\n",
    "        \"\"\"\n",
    "        display(HTML(html))\n",
    "    \n",
    "    def show_performance_metrics(self) -> None:\n",
    "        \"\"\"\n",
    "        Display performance metrics for the models.\n",
    "        \"\"\"\n",
    "        if not self.response_times['gpt'] and not self.response_times['llama']:\n",
    "            console.print(\"[bold yellow]No performance data available yet[/bold yellow]\")\n",
    "            return\n",
    "        \n",
    "        # Create DataFrame for metrics\n",
    "        data = {\n",
    "            'Model': [],\n",
    "            'Response Time (s)': []\n",
    "        }\n",
    "        \n",
    "        for model, times in self.response_times.items():\n",
    "            for t in times:\n",
    "                data['Model'].append(model)\n",
    "                data['Response Time (s)'].append(t)\n",
    "        \n",
    "        df = pd.DataFrame(data)\n",
    "        \n",
    "        # Calculate statistics\n",
    "        stats = df.groupby('Model')['Response Time (s)'].agg(['mean', 'min', 'max', 'count'])\n",
    "        \n",
    "        # Display statistics\n",
    "        console.print(\"\\n[bold]Performance Statistics:[/bold]\")\n",
    "        console.print(stats)\n",
    "        \n",
    "        # Create visualization\n",
    "        plt.figure(figsize=(10, 6))\n",
    "        \n",
    "        # Box plot\n",
    "        ax = plt.subplot(1, 2, 1)\n",
    "        df.boxplot(column='Response Time (s)', by='Model', ax=ax)\n",
    "        plt.title('Response Time Distribution')\n",
    "        plt.suptitle('')\n",
    "        \n",
    "        # Bar chart for average times\n",
    "        ax = plt.subplot(1, 2, 2)\n",
    "        stats['mean'].plot(kind='bar', ax=ax, color=['#4285F4', '#34A853'])\n",
    "        plt.title('Average Response Time')\n",
    "        plt.ylabel('Seconds')\n",
    "        \n",
    "        plt.tight_layout()\n",
    "        plt.show()\n",
    "    \n",
    "    def save_history(self, filename: str = 'tutor_history.json') -> None:\n",
    "        \"\"\"\n",
    "        Save the question and response history to a file.\n",
    "        \n",
    "        Args:\n",
    "            filename: The filename to save to\n",
    "        \"\"\"\n",
    "        try:\n",
    "            with open(filename, 'w') as f:\n",
    "                json.dump(self.history, f, indent=2)\n",
    "            console.print(f\"[bold green]History saved to {filename}[/bold green]\")\n",
    "        except Exception as e:\n",
    "            console.print(f\"[bold red]Error saving history:[/bold red] {str(e)}\")\n",
    "    \n",
    "    def load_history(self, filename: str = 'tutor_history.json') -> None:\n",
    "        \"\"\"\n",
    "        Load question and response history from a file.\n",
    "        \n",
    "        Args:\n",
    "            filename: The filename to load from\n",
    "        \"\"\"\n",
    "        try:\n",
    "            with open(filename, 'r') as f:\n",
    "                self.history = json.load(f)\n",
    "            console.print(f\"[bold green]History loaded from {filename}[/bold green]\")\n",
    "        except FileNotFoundError:\n",
    "            console.print(f\"[bold yellow]History file {filename} not found[/bold yellow]\")\n",
    "        except Exception as e:\n",
    "            console.print(f\"[bold red]Error loading history:[/bold red] {str(e)}\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "3f0d0137-52b0-47a8-81a8-11a90a010798",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold\">LLM Tutor initialized successfully!</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[1;32mLLM Tutor initialized successfully!\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\n",
    "# Create a tutor instance\n",
    "tutor = LLMTutor()\n",
    "console.print(\"[bold green]LLM Tutor initialized successfully![/bold green]\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "25a36470-a68f-40f6-bea1-d2ebb173c015",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #000080; text-decoration-color: #000080\">╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #000080; text-decoration-color: #000080\">│</span> <span style=\"font-weight: bold\">Question:</span>                                                                                                       <span style=\"color: #000080; text-decoration-color: #000080\">│</span>\n",
       "<span style=\"color: #000080; text-decoration-color: #000080\">│</span>                                                                                                                 <span style=\"color: #000080; text-decoration-color: #000080\">│</span>\n",
       "<span style=\"color: #000080; text-decoration-color: #000080\">│</span> Given a list of dictionaries called 'books', write code to find and print all information                       <span style=\"color: #000080; text-decoration-color: #000080\">│</span>\n",
       "<span style=\"color: #000080; text-decoration-color: #000080\">│</span> about the book titled 'Mastery' by Robert Greene.                                                               <span style=\"color: #000080; text-decoration-color: #000080\">│</span>\n",
       "<span style=\"color: #000080; text-decoration-color: #000080\">│</span>                                                                                                                 <span style=\"color: #000080; text-decoration-color: #000080\">│</span>\n",
       "<span style=\"color: #000080; text-decoration-color: #000080\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[34m╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\u001b[0m\n",
       "\u001b[34m│\u001b[0m \u001b[1mQuestion:\u001b[0m                                                                                                       \u001b[34m│\u001b[0m\n",
       "\u001b[34m│\u001b[0m                                                                                                                 \u001b[34m│\u001b[0m\n",
       "\u001b[34m│\u001b[0m Given a list of dictionaries called 'books', write code to find and print all information                       \u001b[34m│\u001b[0m\n",
       "\u001b[34m│\u001b[0m about the book titled 'Mastery' by Robert Greene.                                                               \u001b[34m│\u001b[0m\n",
       "\u001b[34m│\u001b[0m                                                                                                                 \u001b[34m│\u001b[0m\n",
       "\u001b[34m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\n",
    "# Define your question here\n",
    "question = \"\"\"\n",
    "Given a list of dictionaries called 'books', write code to find and print all information \n",
    "about the book titled 'Mastery' by Robert Greene.\n",
    "\"\"\"\n",
    "\n",
    "console.print(Panel(f\"[bold]Question:[/bold]\\n{question}\", border_style=\"blue\"))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "bceaeaf9-4d08-4380-b757-597b851dd8ca",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n",
       "│ <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">Getting response from gpt-4o-mini...</span>                                                                            │\n",
       "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
       "</pre>\n"
      ],
      "text/plain": [
       "╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n",
       "│ \u001b[1;34mGetting response from gpt-4o-mini...\u001b[0m                                                                            │\n",
       "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/markdown": [
       "To find and print all information about the book titled \"Mastery\" by Robert Greene from a list of dictionaries called `books`, we can write a function that iterates through the list, checks for the specific title and author, and then prints the information if a match is found. Here's a step-by-step explanation followed by the code.\n",
       "\n",
       "### Steps to Follow:\n",
       "\n",
       "1. **Structure of the Data**: \n",
       "   Each book in the `books` list is a dictionary. We need to understand how the book's information is structured. A typical dictionary might look like this:\n",
       "   \n",
       "   {\n",
       "       'title': 'Mastery',\n",
       "       'author': 'Robert Greene',\n",
       "       'year': 2012,\n",
       "       'genre': 'Non-fiction',\n",
       "       'isbn': '978-0143124177'\n",
       "   }\n",
       "   \n",
       "\n",
       "2. **Iterate through the List**:\n",
       "   We will use a loop to go through each book in the `books` list. \n",
       "\n",
       "3. **Check for Conditions**:\n",
       "   For each book (dictionary), we need to check if the 'title' is 'Mastery' and the 'author' is 'Robert Greene'. \n",
       "\n",
       "4. **Print the Details**: \n",
       "   If we find a match, we will print all the details of that book.\n",
       "\n",
       "### Example Code\n",
       "\n",
       "Here’s a Python code snippet that accomplishes this:\n",
       "\n",
       "\n",
       "# Sample list of dictionaries representing books\n",
       "books = [\n",
       "    {'title': 'Mastery', 'author': 'Robert Greene', 'year': 2012, 'genre': 'Non-fiction', 'isbn': '978-0143124177'},\n",
       "    {'title': 'The 48 Laws of Power', 'author': 'Robert Greene', 'year': 1998, 'genre': 'Non-fiction', 'isbn': '978-0140280197'},\n",
       "    {'title': 'The Art of War', 'author': 'Sun Tzu', 'year': '5th century BC', 'genre': 'Philosophy', 'isbn': '978-1590302255'}\n",
       "]\n",
       "\n",
       "# Function to find and print information about the book titled 'Mastery' by Robert Greene\n",
       "def find_book(books):\n",
       "    for book in books:\n",
       "        # Check if the title and author match\n",
       "        if book.get('title') == 'Mastery' and book.get('author') == 'Robert Greene':\n",
       "            # Print the entire dictionary if a match is found\n",
       "            print(\"Found book:\")\n",
       "            for key, value in book.items():\n",
       "                print(f\"{key}: {value}\")\n",
       "            return  # Exit the function after finding the book\n",
       "    print(\"Book not found.\")  # Optional: Print if the book is not in the list\n",
       "\n",
       "# Call the function\n",
       "find_book(books)\n",
       "\n",
       "\n",
       "### Explanation of the Code:\n",
       "\n",
       "1. **Data Structure**: The `books` variable is initialized as a list containing dictionary elements, where each dictionary represents a book.\n",
       "\n",
       "2. **Function Definition**: The function `find_book(books)` takes the list of books as an argument.\n",
       "\n",
       "3. **Iteration**: The `for` loop iterates over each book in the `books` list.\n",
       "\n",
       "4. **Finding the Match**: It checks if the title and author of the current book (retrieved using the `get` method to avoid `KeyError`) match 'Mastery' and 'Robert Greene'.\n",
       "\n",
       "5. **Printing Details**: If a match is found, it prints out the key-value pairs from the dictionary in a formatted manner.\n",
       "\n",
       "6. **Exit after Finding**: The `return` statement ensures that the function exits as soon as the book is found.\n",
       "\n",
       "7. **Not Found Condition**: If no book matches the criteria, it prints \"Book not found.\"\n",
       "\n",
       "### Conclusion\n",
       "This method is efficient for small to moderately sized lists of dictionaries. If you have a very large dataset, consider using more efficient search algorithms or data structures like dictionaries for faster lookups, but the above approach should work well for typical use cases."
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n",
       "│ <span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold\">Getting response from llama3.2...</span>                                                                               │\n",
       "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
       "</pre>\n"
      ],
      "text/plain": [
       "╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n",
       "│ \u001b[1;32mGetting response from llama3.2...\u001b[0m                                                                               │\n",
       "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/markdown": [
       "## llama3.2 Response\n",
       "Here's an example of how you can achieve this using Python:\n",
       "\n",
       "**Problem Statement**\n",
       "\n",
       "Given a list of dictionaries called `books`, where each dictionary represents a book with its title, author, publication year, etc., write code to find and print all information about the book titled `'Mastery'` by Robert Greene.\n",
       "\n",
       "**Example Input Data**\n",
       "```python\n",
       "books = [\n",
       "    {'title': 'Mastery', 'author': 'Robert Greene', 'publication_year': 2012, 'genre': 'Self-Help'},\n",
       "    {'title': 'The 48 Laws of Power', 'author': 'Robert Greene', 'publication_year': 2007, 'genre': 'Non-Fiction'},\n",
       "    {'title': 'To Kill a Mockingbird', 'author': 'Harper Lee', 'publication_year': 1960, 'genre': 'Classic Fiction'},\n",
       "    {'title': 'Mastery', 'author': 'Robert Greene', 'publication_year': 2018, 'genre': 'Self-Help'}  # duplicate title\n",
       "]\n",
       "```\n",
       "**Solution**\n",
       "\n",
       "Here's the Python code that finds and prints all information about the book titled `'Mastery'` by Robert Greene:\n",
       "```python\n",
       "# Define a function to find books with a specific title and author\n",
       "def find_book(books, title, author):\n",
       "    \"\"\"\n",
       "    Find all books in the list that match the given title and author.\n",
       "\n",
       "    Args:\n",
       "        books (list): List of dictionaries representing books.\n",
       "        title (str): Title of the book to search for.\n",
       "        author (str): Author of the book to search for.\n",
       "\n",
       "    Returns:\n",
       "        list: List of dictionaries representing the found books.\n",
       "    \"\"\"\n",
       "    return [book for book in books if book['title'] == title and book['author'] == author]\n",
       "\n",
       "# Define a function to print book information\n",
       "def print_book_info(book):\n",
       "    \"\"\"\n",
       "    Print all information about a single book.\n",
       "\n",
       "    Args:\n",
       "        book (dict): Dictionary representing the book.\n",
       "    \"\"\"\n",
       "    print(f\"Title: {book['title']}\")\n",
       "    print(f\"Author: {book['author']}\")\n",
       "    print(f\"Publication Year: {book['publication_year']}\")\n",
       "    print(f\"Genre: {book['genre']}\\n\")\n",
       "\n",
       "# Find and print information about the book titled 'Mastery' by Robert Greene\n",
       "target_title = \"Mastery\"\n",
       "target_author = \"Robert Greene\"\n",
       "\n",
       "found_books = find_book(books, target_title, target_author)\n",
       "\n",
       "if found_books:\n",
       "    for i, book in enumerate(found_books):\n",
       "        print(f\"Book {i+1}:\")\n",
       "        print_book_info(book)\n",
       "else:\n",
       "    print(f\"No books found with title '{target_title}' by author '{target_author}'.\")\n",
       "```\n",
       "**Explanation**\n",
       "\n",
       "The solution consists of two functions:\n",
       "\n",
       "1. `find_book`: This function takes a list of dictionaries representing books, as well as the title and author to search for. It uses a list comprehension to find all books that match the given criteria and returns them.\n",
       "2. `print_book_info`: This function takes a single dictionary representing a book and prints its information.\n",
       "\n",
       "In the example code, we define the `books` list with some sample data. We then call the `find_book` function to find all books with the title `'Mastery'` by Robert Greene. If found books are returned, we iterate over them and print their information using the `print_book_info` function.\n",
       "\n",
       "Note that if there are duplicate titles in the input data, only one book will be returned by the `find_book` function, as dictionaries cannot have duplicate keys."
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\n",
    "# Get responses from both models\n",
    "responses = tutor.ask(question)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "60ce7000-a4a5-4cce-a261-e75ef45063b4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "        <div style=\"display: flex; width: 100%;\">\n",
       "            <div style=\"flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 5px; margin-right: 10px;\">\n",
       "                <h3 style=\"color: #4285F4;\">gpt-4o-mini</h3>\n",
       "                <div style=\"white-space: pre-wrap;\">To find and print all information about the book titled \"Mastery\" by Robert Greene from a list of dictionaries called `books`, we can write a function that iterates through the list, checks for the specific title and author, and then prints the information if a match is found. Here's a step-by-step explanation followed by the code.\n",
       "\n",
       "### Steps to Follow:\n",
       "\n",
       "1. **Structure of the Data**: \n",
       "   Each book in the `books` list is a dictionary. We need to understand how the book's information is structured. A typical dictionary might look like this:\n",
       "   ```python\n",
       "   {\n",
       "       'title': 'Mastery',\n",
       "       'author': 'Robert Greene',\n",
       "       'year': 2012,\n",
       "       'genre': 'Non-fiction',\n",
       "       'isbn': '978-0143124177'\n",
       "   }\n",
       "   ```\n",
       "\n",
       "2. **Iterate through the List**:\n",
       "   We will use a loop to go through each book in the `books` list. \n",
       "\n",
       "3. **Check for Conditions**:\n",
       "   For each book (dictionary), we need to check if the 'title' is 'Mastery' and the 'author' is 'Robert Greene'. \n",
       "\n",
       "4. **Print the Details**: \n",
       "   If we find a match, we will print all the details of that book.\n",
       "\n",
       "### Example Code\n",
       "\n",
       "Here’s a Python code snippet that accomplishes this:\n",
       "\n",
       "```python\n",
       "# Sample list of dictionaries representing books\n",
       "books = [\n",
       "    {'title': 'Mastery', 'author': 'Robert Greene', 'year': 2012, 'genre': 'Non-fiction', 'isbn': '978-0143124177'},\n",
       "    {'title': 'The 48 Laws of Power', 'author': 'Robert Greene', 'year': 1998, 'genre': 'Non-fiction', 'isbn': '978-0140280197'},\n",
       "    {'title': 'The Art of War', 'author': 'Sun Tzu', 'year': '5th century BC', 'genre': 'Philosophy', 'isbn': '978-1590302255'}\n",
       "]\n",
       "\n",
       "# Function to find and print information about the book titled 'Mastery' by Robert Greene\n",
       "def find_book(books):\n",
       "    for book in books:\n",
       "        # Check if the title and author match\n",
       "        if book.get('title') == 'Mastery' and book.get('author') == 'Robert Greene':\n",
       "            # Print the entire dictionary if a match is found\n",
       "            print(\"Found book:\")\n",
       "            for key, value in book.items():\n",
       "                print(f\"{key}: {value}\")\n",
       "            return  # Exit the function after finding the book\n",
       "    print(\"Book not found.\")  # Optional: Print if the book is not in the list\n",
       "\n",
       "# Call the function\n",
       "find_book(books)\n",
       "```\n",
       "\n",
       "### Explanation of the Code:\n",
       "\n",
       "1. **Data Structure**: The `books` variable is initialized as a list containing dictionary elements, where each dictionary represents a book.\n",
       "\n",
       "2. **Function Definition**: The function `find_book(books)` takes the list of books as an argument.\n",
       "\n",
       "3. **Iteration**: The `for` loop iterates over each book in the `books` list.\n",
       "\n",
       "4. **Finding the Match**: It checks if the title and author of the current book (retrieved using the `get` method to avoid `KeyError`) match 'Mastery' and 'Robert Greene'.\n",
       "\n",
       "5. **Printing Details**: If a match is found, it prints out the key-value pairs from the dictionary in a formatted manner.\n",
       "\n",
       "6. **Exit after Finding**: The `return` statement ensures that the function exits as soon as the book is found.\n",
       "\n",
       "7. **Not Found Condition**: If no book matches the criteria, it prints \"Book not found.\"\n",
       "\n",
       "### Conclusion\n",
       "This method is efficient for small to moderately sized lists of dictionaries. If you have a very large dataset, consider using more efficient search algorithms or data structures like dictionaries for faster lookups, but the above approach should work well for typical use cases.</div>\n",
       "            </div>\n",
       "            <div style=\"flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 5px;\">\n",
       "                <h3 style=\"color: #34A853;\">llama3.2</h3>\n",
       "                <div style=\"white-space: pre-wrap;\">Here's an example of how you can achieve this using Python:\n",
       "\n",
       "**Problem Statement**\n",
       "\n",
       "Given a list of dictionaries called `books`, where each dictionary represents a book with its title, author, publication year, etc., write code to find and print all information about the book titled `'Mastery'` by Robert Greene.\n",
       "\n",
       "**Example Input Data**\n",
       "```python\n",
       "books = [\n",
       "    {'title': 'Mastery', 'author': 'Robert Greene', 'publication_year': 2012, 'genre': 'Self-Help'},\n",
       "    {'title': 'The 48 Laws of Power', 'author': 'Robert Greene', 'publication_year': 2007, 'genre': 'Non-Fiction'},\n",
       "    {'title': 'To Kill a Mockingbird', 'author': 'Harper Lee', 'publication_year': 1960, 'genre': 'Classic Fiction'},\n",
       "    {'title': 'Mastery', 'author': 'Robert Greene', 'publication_year': 2018, 'genre': 'Self-Help'}  # duplicate title\n",
       "]\n",
       "```\n",
       "**Solution**\n",
       "\n",
       "Here's the Python code that finds and prints all information about the book titled `'Mastery'` by Robert Greene:\n",
       "```python\n",
       "# Define a function to find books with a specific title and author\n",
       "def find_book(books, title, author):\n",
       "    \"\"\"\n",
       "    Find all books in the list that match the given title and author.\n",
       "\n",
       "    Args:\n",
       "        books (list): List of dictionaries representing books.\n",
       "        title (str): Title of the book to search for.\n",
       "        author (str): Author of the book to search for.\n",
       "\n",
       "    Returns:\n",
       "        list: List of dictionaries representing the found books.\n",
       "    \"\"\"\n",
       "    return [book for book in books if book['title'] == title and book['author'] == author]\n",
       "\n",
       "# Define a function to print book information\n",
       "def print_book_info(book):\n",
       "    \"\"\"\n",
       "    Print all information about a single book.\n",
       "\n",
       "    Args:\n",
       "        book (dict): Dictionary representing the book.\n",
       "    \"\"\"\n",
       "    print(f\"Title: {book['title']}\")\n",
       "    print(f\"Author: {book['author']}\")\n",
       "    print(f\"Publication Year: {book['publication_year']}\")\n",
       "    print(f\"Genre: {book['genre']}\\n\")\n",
       "\n",
       "# Find and print information about the book titled 'Mastery' by Robert Greene\n",
       "target_title = \"Mastery\"\n",
       "target_author = \"Robert Greene\"\n",
       "\n",
       "found_books = find_book(books, target_title, target_author)\n",
       "\n",
       "if found_books:\n",
       "    for i, book in enumerate(found_books):\n",
       "        print(f\"Book {i+1}:\")\n",
       "        print_book_info(book)\n",
       "else:\n",
       "    print(f\"No books found with title '{target_title}' by author '{target_author}'.\")\n",
       "```\n",
       "**Explanation**\n",
       "\n",
       "The solution consists of two functions:\n",
       "\n",
       "1. `find_book`: This function takes a list of dictionaries representing books, as well as the title and author to search for. It uses a list comprehension to find all books that match the given criteria and returns them.\n",
       "2. `print_book_info`: This function takes a single dictionary representing a book and prints its information.\n",
       "\n",
       "In the example code, we define the `books` list with some sample data. We then call the `find_book` function to find all books with the title `'Mastery'` by Robert Greene. If found books are returned, we iterate over them and print their information using the `print_book_info` function.\n",
       "\n",
       "Note that if there are duplicate titles in the input data, only one book will be returned by the `find_book` function, as dictionaries cannot have duplicate keys.</div>\n",
       "            </div>\n",
       "        </div>\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\n",
    "# Compare responses side by side\n",
    "tutor.compare_responses()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "f00c09c3-1728-442b-94f1-548255fb95b4",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">\n",
       "<span style=\"font-weight: bold\">Performance Statistics:</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\n",
       "\u001b[1mPerformance Statistics:\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">            mean        min        max  count\n",
       "Model                                        \n",
       "gpt    <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">14.672200</span>  <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">14.672200</span>  <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">14.672200</span>      <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>\n",
       "llama  <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">79.891858</span>  <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">79.891858</span>  <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">79.891858</span>      <span style=\"color: #008080; text-decoration-color: #008080; font-weight: bold\">1</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "            mean        min        max  count\n",
       "Model                                        \n",
       "gpt    \u001b[1;36m14.672200\u001b[0m  \u001b[1;36m14.672200\u001b[0m  \u001b[1;36m14.672200\u001b[0m      \u001b[1;36m1\u001b[0m\n",
       "llama  \u001b[1;36m79.891858\u001b[0m  \u001b[1;36m79.891858\u001b[0m  \u001b[1;36m79.891858\u001b[0m      \u001b[1;36m1\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA90AAAI/CAYAAABqNbq7AAAAOnRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjEwLjEsIGh0dHBzOi8vbWF0cGxvdGxpYi5vcmcvc2/+5QAA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8revXurefPmSk1N1bRp01SjRg03VudZzv7MUbduXVWpUqXEz0hWf/EOnAunl8MSRQF87969Lu2rV6/WzTffrKCgINWoUUNt2rTRBx984DImPz9fjz/+uMLDw1WjRg0FBQWpffv2eu+998wxsbGx8vPzU1ZWlnr27ClfX1/VrVtXI0eOVH5+vsvyjh07psTERIWHh6t69eq64oorNGLEiGKnJjds2FD9+vXT0qVL1bZtW3l7e6tZs2bmt/Vlqa+023oxSjq9vOh5+eWXX9SrVy/5+voqJCREEydOlCStWrVK1157rXx9fdWkSROlpqYWW252draGDRumK6+8UtWrV1d4eLjGjRunEydOXFS99957r/r06aMFCxZox44dZvvZp3yfOnVKEyZMUNOmTeXt7a2aNWuqVatWeumllyRJTqdTTzzxhCQpPDzc5bSxouX169dPixYtUps2bVSjRg3zyPO5TmU/duyY4uPj5XA45O3trW7duunHH390GdO9e/diR64luZyqtn37djNUjxs3zuXnANK5Ty9/6623dM0115j/n/72t79p48aNxdbj5+enLVu2qE+fPvLz81NYWJgee+wxFRQUnPN5B4BLbdasWZKkiRMnKioqSvPnzzf3zYWFhapXr57uvvvuYvMdPHhQ3t7eio+PN9tyc3PNfW7RPjwuLk5Hjhxxmddms2nkyJGaOXOmrrrqKtntdnMfN27cOHXq1ElBQUEKCAhQ27ZtNWvWLBmG4bKMgoICPfbYY3I4HPLx8dH111+vNWvWlLjvKO99ZbVq1dS6dWsdP37c5fOJYRh69dVX1bp1a3l7e6tWrVoaNGiQtm7d6jL/jz/+qH79+qlevXqy2+0KDQ1V37599dtvvxV7jl577TU1adJEdrtdzZs31/z584vV89///le33HKLatWqpRo1aqh169bFPjMUfQ557733NHbsWIWGhiogIEA33nijNm3aVOb6SrutF6Ok08uLnpfZs2ebnz3at2+vVatWyTAMvfDCCwoPD5efn59uuOEGbdmypdhyv/zyS/Xs2VMBAQHy8fFR165d9dVXX5Vb3fB8HOmGJbZt2yZJatKkidm2bNky3XTTTerUqZNmzpypwMBAzZ8/X//4xz+Un59v7tDi4+P19ttva8KECWrTpo2OHDmi//73v9q3b5/LOgoLC9WnTx8NGzZMY8aM0YoVKzRhwgTt2LFDn3zyiaTTf8AHDBigr776SomJibruuuu0fv16PfPMM1q5cqVWrlwpu91uLvOnn37SY489pjFjxig4OFhvvvmm7rvvPjVu3FjXX399qesr7bZaobCwUAMHDtSDDz6oJ554QvPmzVNiYqJyc3O1cOFCjR49WldeeaVefvllxcbGqkWLFmrXrp2k0x8iOnbsqCpVqujpp59WRESEVq5cqQkTJmj79u2aPXv2RdV2880367PPPtN3332nBg0alDhm0qRJcjqd+te//qXrr79ehYWF+uWXX8wPIffff7/279+vl19+WYsWLTJP1T7zNPu1a9dq48aN+te//qXw8HD5+vqet64nn3xSbdu21ZtvvqlDhw7J6XSqe/fu+vHHH9WoUaNSb19ISIiWLl2qm266Sffdd5/uv/9+STrv0e3k5GQ9+eSTuuOOO5ScnKx9+/bJ6XSqS5cuyszMVGRkpDm2sLBQN998s+677z499thj+vbbb/Xss88qMDBQTz/9dKnrBACrHD16VO+99546dOigFi1aaOjQobr//vu1YMECDRkyRF5eXrrrrrs0c+ZMvfLKKy5HHt977z0dO3bMPEMuPz9f3bp102+//aYnn3xSrVq1UlZWlp5++mlt2LBBX375pWw2mzn/kiVL9N133+npp5+Ww+FQvXr1JJ3+QnTYsGGqX7++pNNfQD/88MPavXu3y9/Oe++9V++//74SEhJ0ww036Oeff9bf/vY35ebmumyjVfvKbdu2qWbNmi77jGHDhmnOnDkaNWqUnn/+ee3fv1/jx49XVFSUfvrpJwUHB+vIkSOKjo5WeHi4XnnlFQUHBys7O1vLli1TXl6eyzo+/vhjLVu2TOPHj5evr69effVV3XHHHapWrZoGDRokSdq0aZOioqJUr149TZs2TbVr19Y777yj2NhY7d27VwkJCS7LfPLJJ9W1a1e9+eabys3N1ejRo9W/f39t3LhRVatWLXV9pdlWq3z66af68ccfNXHiRNlsNo0ePVp9+/bVkCFDtHXrVk2fPl2HDh1SfHy8br31Vq1bt878v/fOO+/onnvu0S233KLU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e+65xxzTsGFDLViwQAUFBeb69+3bpxUrVrhcCKgstXXp0kXe3t565513dNttt5ntv/32m77++mvz6BAAVHQnT55UamqqIiIi9Oabbxbr//TTTzV58mR9/vnn6tevn2rVqqUBAwZo7ty56tKli7Kzs11OLZdO75OSkpJUu3ZthYeHX1BdNptN1apVU9WqVc22o0eP6u2333YZV/Rl8Pvvv6+2bdua7R9++GGxK5Jbsa+sXbu2Jk6cqHvvvVcvv/yyEhMT1a9fP02cOFG7d+8udtr7udhsNl1zzTWaOnWq5syZo7Vr17r0f/XVV9q7d68ZBE+ePKn3339fERERuvLKKyWd/uy0ePFi/f777y5fIMydO1c+Pj4XdbvSc9V3IdtaEXTt2lU1a9bUzz//rJEjR7q7HFRghG5YolatWkpMTFRCQoLmzZunu+66S6+99pp69+6tXr16KTY2VldccYX279+vjRs3au3atVqwYIEkqVOnTurXr59atWqlWrVqaePGjXr77bfVpUsXl8BdvXp1TZ48WYcPH1aHDh3Mq5f37t1b1157rSQpOjpavXr10ujRo5Wbm6uuXbuaVy9v06ZNibcs+Sulqa+021rRjB8/Xunp6YqKitKoUaPUtGlTHTt2TNu3b9dnn32mmTNnmjvlczl69KhWrVpl/nvr1q1asmSJPv30U3Xr1k0zZ8487/z9+/c37/tet25d7dixQykpKWrQoIF5Je+WLVtKkl566SXzarhNmzaVv7//BW13Tk6O/va3v+mBBx7QoUOH9Mwzz6hGjRpKTEw0x9x999167bXXdNddd+mBBx7Qvn37NGnSpGL3/PT391eDBg300UcfqWfPngoKClKdOnWK3aJEOv2lwlNPPaUnn3xS99xzj+644w7t27dP48aNU40aNfTMM89c0PYAwKX2+eef6/fff9fzzz9f4u0VW7RooenTp2vWrFnq16+fpNOnmL///vsaOXKkrrzySt14440u88TFxWnhwoW6/vrr9eijj6pVq1Y6deqUdu7cqbS0ND322GN/ef/vvn37asqUKRo8eLD++c9/at++fXrxxReLHTm9+uqrdccdd2jy5MmqWrWqbrjhBmVlZWny5MkKDAxUlSr/94vM8thXluSee+7RlClT9OKLL2rEiBHq2rWr/vnPf+ree+/V6tWrdf3118vX11d79uzR8uXL1bJlSz300EP69NNP9eqrr2rAgAFq1KiRDMPQokWLdPDgQUVHR7uso06dOrrhhhv01FNPmVcv/+WXX1xOa3/mmWfM360//fTTCgoK0rvvvqt///vfmjRpkgIDA8u0XaWpr7TbWtH4+fnp5Zdf1pAhQ7R//34NGjRI9erV0x9//KGffvpJf/zxh2bMmOHuMlERuOf6bbhcFF2N+ewrixrG6St/169f34iMjDROnDhhGIZh/PTTT8bf//53o169eoaXl5fhcDiMG264weVqnWPGjDHat29v1KpVy7Db7UajRo2MRx991Pjzzz/NMUVXply/fr3RvXt3w9vb2wgKCjIeeughl6tPFtUxevRoo0GDBoaXl5cREhJiPPTQQ8aBAwdcxjVo0MDo27dvse04+6rVpamvtNv6Vy7k6uUlXbHzXFcVL2mb//jjD2PUqFFGeHi44eXlZQQFBRnt2rUzxo4dW+y5LWk9ksyHr6+v0ahRI2PQoEHGggULSrxq+9lXFJ88ebIRFRVl1KlTx6hevbpRv35947777jO2b9/uMl9iYqIRGhpqVKlSxeV5ONfrWNK6ip7Dt99+2xg1apRRt25dw263G9ddd52xevXqYvOnpqYaV111lVGjRg2jefPmxvvvv1/ilVC//PJLo02bNobdbne56u3ZVy8v8uabbxqtWrUyqlevbgQGBhq33HJLsavfnuu1feaZZwz+lANwtwEDBhjVq1c3cnJyzjnm9ttvN6pVq2ZePfvkyZNGWFiYIckYO3ZsifMcPnzY+Ne//mU0bdrU/BvZsmVL49FHH3W5CrckY8SIESUu46233jKaNm1q7rOTk5ONWbNmFft7fOzYMSM+Pt6oV6+eUaNGDaNz587GypUrjcDAQOPRRx91WebF7ivPdaePf//734YkY9y4cS71d+rUyfD19TW8vb2NiIgI45577jH3U7/88otxxx13GBEREYa3t7cRGBhodOzY0ZgzZ47Lsoueo1dffdWIiIgwvLy8jGbNmhnvvvtusTo2bNhg9O/f3wgMDDSqV69uXHPNNcbs2bNdxpzrM8q2bdsMSeb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/H399df66KOP1KFDB1WpUkUNGjRQdHS0AgIClJycrL59+7q7RJQTftONv2QYhqTT336X1H4+Z88D4Nx27NihPn36qEWLFlq4cKHWrFmjV155RdLpo9tFvLy8XOaz2WwlthV9iD5y5IhiYmLk5+end955R5mZmVq8eLGk06edA0CRbdu2EbiBS+TIkSOqV6+eJCkoKEh//PGHJKlly5Zau3atO0tDOSN04y9FRETIy8tLP/zwg9mWm5urzZs3u4xbtWpVselmzZqZ015eXvw2BTiP1atX68SJE5o8ebI6d+6sJk2a6Pfff7/o5f7yyy/6888/NXHiRF133XVq1qwZF1EDcE5fffWV+vXrp4iICDVu3Fj9+vXTl19+6e6ygMtO06ZNtWnTJklS69at9dprr2n37t2aOXOmQkJC3FwdyhOhG3/J399fQ4YM0RNPPKFly5YpKytLQ4cOVZUqVVyOZH///feaNGmSfv31V73yyitasGCBHnnkEbO/YcOG+uqrr5Sdna0DBw64Y1OACi0iIkInTpzQyy+/rK1bt+rtt9/WzJkzL3q59evXV/Xq1c3lfvzxx3r22WfLoWIAl5vp06frpptukr+/vx555BGNGjVKAQEB6tOnj6ZPn+7u8oDLSlxcnPbs2SNJeuaZZ7R06VLVr19f06ZNU1JSkpurQ3kidKNUpkyZoi5duqhfv3668cYb1bVrV1111VWqUaOGOeaxxx7TmjVr1KZNGz377LOaPHmyevXqZfZPnjxZ6enpCgsLU5s2bdyxGUCF1rp1a02ZMkXPP/+8WrRooXfffVfJyckXvdy6detqzpw5WrBggZo3b66JEyfqxRdfLIeKAVxukpOTNXXqVL333nsaNWqURo0apXnz5mnq1KmEAKCc3XnnnYqNjZUktWnTRtu3b1dmZqZ27dplXggVlwebUZof5gJnOXLkiK644gpNnjxZ9913nxo2bKi4uDiXKy8DAADP4u/vrx9//FGNGzd2ad+8ebPatGmjw4cPu6kyAPBcXL0cpfLjjz/ql19+UceOHXXo0CGNHz9eknTLLbe4uTIAAFBebr75Zi1evFhPPPGES/tHH32k/v37u6kq4PJkGIY+/PBDLVu2TDk5OeY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iIkJ+fnzmmdevW7isQuIzws7zKg9ANeLB7771Xs2fPNkP3W2+9paFDh+qbb74xxyQkJGjhwoVKTU1VgwYNNGnSJPXq1UtbtmxRUFCQdu3apYEDB+rBBx/UQw89pNWrV+uxxx5zWc+GDRvUq1cvPfvss5o1a5b++OMPjRw5UiNHjtTs2bMv5SYDAC4BPz8/tWrVyt1lAJe1kg5y4PLEb7oBD3b33Xdr+fLl2r59u3bs2KHvv/9ed911l9l/5MgRzZgxQy+88IJ69+6t5s2b64033pC3t7dmzZolSZoxY4YaNWqkqVOnqmnTprrzzjuL/R78hRde0ODBgxUXF6fIyEhFRUVp2rRpmjt3ro4dO3YpNxkAAOCyc/ToUeXm5ro8cPngSDfgwerUqaO+ffsqNTVVhmGob9++qlOnjtn/v//9T4WFheratavZ5uXlpY4dO2rjxo2SpI0bN6pz584u94bs0qWLy3rWrFmjLVu26N133zXbDMPQqVOntG3bNl111VVWbSIAAMBl6ciRIxo9erQ++OAD7du3r1j/yZMn3VAVrEDoBjzc0KFDNXLkSEnSK6+84tJnGIYkuQTqovaitqIx53Pq1CkNGzZMo0aNKtbHRdsAAADKLiEhQcuWLdOrr76qe+65R6+88op2796t1157TRMnTnR3eShHnF4OeLibbrpJx48f1/Hjx9WrVy+XvsaNG6t69epavny52VZYWKjVq1ebR6ebN2+uVatWucx39nTbtm2VlZWlxo0bF3tUr17doi0DAAC4fH3yySd69dVXNWjQIFWrVk3XXXed/vWvfykpKcnl7EJ4PkI34OGqVq2qjRs3auPGjapatapLn6+vrx566CE98cQTWrp0qX7++Wc98MADys/P13333SdJevDBB/W///1P8fHx2rRpk+bNm6c5c+a4LGf06NFauXKlRowYoXXr1mnz5s36+OOP9fDDD1+qzQQAALis7N+/X+Hh4ZKkgIAA8xZh1157rb799lt3loZyRugGLgMBAQEKCAgosW/ixIm69dZbdffdd6tt27basmWLvvjiC9WqVUvS6dPDFy5cqE8++UTXXHONZs6cqaSkJJdltGrVShkZGdq8ebOuu+46tWnTRk899ZR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hGJLkEqiL2ovaisacz6lTpzRs2DCNGjWqWB8XbQPKH6eXAwAAABXETTfdpOPHj+v48ePq1auXS1/jxo1VvXp1LV++3GwrLCzU6tWrzaPTzZs316pVq1zmO3u6bdu2ysrKUuPGjYs9qlevbtGWAZUXoRsAAACoIKpWraqNGzdq48aNqlq1qkufr6+vHnroIT3xxBNaunSpfv75Zz3wwAPKz8/XfffdJ0l68MEH9b///U/x8fHatGmT5s2bpzlz5rgsZ/To0Vq5cqVGjBihdevWafPmzfr444/18MMPX6rNBCoVQjcAAABQgQQEBCggIKDEvokTJ+rWW2/V3XffrbZt22rLli364osvVKtWLUmnTw9fuHChPvnkE11zzTWaOXOmkpKSXJbRqlUrZWRkaPPmzbruuuvUpk0bPfXUUwoJCbF824DKyGaU5ocfAAAAAACgzDjSDQAAAACARQjdAAAAAABYhNANAAAAAIBFCN0AAAAAAFiE0A0AAAAAgEUI3QAAAAAAWITQDQAAAACARQjdAAAAAABYhNANAAAAAIBFCN0AAAAAAFiE0A0AAAAAgEUI3QAAAAAAWOT/AQCTJnuW6jTEAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 1000x600 with 2 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\n",
    "# Show performance metrics\n",
    "tutor.show_performance_metrics()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "41f5122e-96e9-4fda-9b4f-e8cf4caff552",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold\">History saved to my_tutor_session.json</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[1;32mHistory saved to my_tutor_session.json\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\n",
    "# Save history to a file\n",
    "tutor.save_history(\"my_tutor_session.json\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "4aa6afbf-1cc1-4ed1-a65f-14ee02ce278f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"><span style=\"color: #008000; text-decoration-color: #008000\">╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮</span>\n",
       "<span style=\"color: #008000; text-decoration-color: #008000\">│</span> <span style=\"font-weight: bold\">New Question:</span>                                                                                                   <span style=\"color: #008000; text-decoration-color: #008000\">│</span>\n",
       "<span style=\"color: #008000; text-decoration-color: #008000\">│</span> Explain how to implement a binary search algorithm in Python.                                                   <span style=\"color: #008000; text-decoration-color: #008000\">│</span>\n",
       "<span style=\"color: #008000; text-decoration-color: #008000\">╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯</span>\n",
       "</pre>\n"
      ],
      "text/plain": [
       "\u001b[32m╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\u001b[0m\n",
       "\u001b[32m│\u001b[0m \u001b[1mNew Question:\u001b[0m                                                                                                   \u001b[32m│\u001b[0m\n",
       "\u001b[32m│\u001b[0m Explain how to implement a binary search algorithm in Python.                                                   \u001b[32m│\u001b[0m\n",
       "\u001b[32m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n",
       "│ <span style=\"color: #000080; text-decoration-color: #000080; font-weight: bold\">Getting response from gpt-4o-mini...</span>                                                                            │\n",
       "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
       "</pre>\n"
      ],
      "text/plain": [
       "╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n",
       "│ \u001b[1;34mGetting response from gpt-4o-mini...\u001b[0m                                                                            │\n",
       "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/markdown": [
       "Binary search is an efficient algorithm for finding a target value within a sorted list. It works by repeatedly dividing the search interval in half. If the target value is less than the element in the middle of the interval, the search continues on the lower half; otherwise, it continues on the upper half. This process is continued until the target value is found or the search interval is empty.\n",
       "\n",
       "Here's a detailed explanation and implementation of the binary search algorithm in Python:\n",
       "\n",
       "### Step-by-Step Implementation\n",
       "\n",
       "1. **Prerequisites**:\n",
       "   - Ensure the input list is sorted. Binary search can only be performed on a sorted list.\n",
       "  \n",
       "2. **Set Initial Variables**:\n",
       "   - Define two pointers, `low` and `high`, which represent the starting and ending indices of the search range in the list.\n",
       "\n",
       "3. **Calculate the Middle Index**:\n",
       "   - Use the formula `mid = (low + high) // 2` to find the middle index.\n",
       "\n",
       "4. **Comparison**:\n",
       "   - Compare the middle element with the target:\n",
       "     - If the middle element is equal to the target, return the index of the middle element.\n",
       "     - If the target is less than the middle element, narrow the search to the left half by setting `high = mid - 1`.\n",
       "     - If the target is greater than the middle element, narrow the search to the right half by setting `low = mid + 1`.\n",
       "\n",
       "5. **Loop Until the Target is Found or the Interval is Empty**:\n",
       "   - Repeat the above steps until the `low` pointer exceeds the `high` pointer. If the target is not found, return a value indicating that the target is not present (commonly -1).\n",
       "\n",
       "### Implementation in Python\n",
       "\n",
       "Here’s a complete Python implementation of the binary search algorithm:\n",
       "\n",
       "\n",
       "def binary_search(arr, target):\n",
       "    low = 0\n",
       "    high = len(arr) - 1\n",
       "\n",
       "    while low <= high:\n",
       "        # Find the middle index\n",
       "        mid = (low + high) // 2\n",
       "        \n",
       "        # Check if the target is present at mid\n",
       "        if arr[mid] == target:\n",
       "            return mid  # Target found, return the index\n",
       "        \n",
       "        # If the target is smaller than the mid element,\n",
       "        # it can only be present in the left subarray\n",
       "        elif arr[mid] > target:\n",
       "            high = mid - 1\n",
       "        \n",
       "        # If the target is larger than the mid element,\n",
       "        # it can only be present in the right subarray\n",
       "        else:\n",
       "            low = mid + 1\n",
       "\n",
       "    # Target was not found\n",
       "    return -1\n",
       "\n",
       "\n",
       "### Example Usage\n",
       "\n",
       "\n",
       "# Example sorted list\n",
       "arr = [1, 3, 5, 7, 9, 11, 13, 15, 17, 19]\n",
       "target = 7\n",
       "\n",
       "# Perform binary search\n",
       "result = binary_search(arr, target)\n",
       "\n",
       "if result != -1:\n",
       "    print(f'Target {target} found at index {result}.')\n",
       "else:\n",
       "    print(f'Target {target} not found in the list.')\n",
       "\n",
       "\n",
       "### Key Points\n",
       "\n",
       "1. **Time Complexity**: The time complexity of binary search is O(log n), where n is the number of elements in the array. This is significantly more efficient than a linear search, which has a time complexity of O(n).\n",
       "  \n",
       "2. **Space Complexity**: The space complexity of the binary search algorithm is O(1) for the iterative version, as it requires a fixed amount of space for variables.\n",
       "\n",
       "3. **Iterative vs Recursive**: The above implementation is iterative, which is generally preferred for binary search due to its efficiency and avoidance of recursion limits. However, a recursive implementation can also be done:\n",
       "\n",
       "### Recursive Implementation\n",
       "\n",
       "\n",
       "def binary_search_recursive(arr, target, low, high):\n",
       "    if low <= high:\n",
       "        mid = (low + high) // 2\n",
       "        \n",
       "        if arr[mid] == target:\n",
       "            return mid\n",
       "        elif arr[mid] > target:\n",
       "            return binary_search_recursive(arr, target, low, mid - 1)\n",
       "        else:\n",
       "            return binary_search_recursive(arr, target, mid + 1, high)\n",
       "    \n",
       "    return -1\n",
       "\n",
       "\n",
       "### Conclusion\n",
       "\n",
       "Binary search is a fundamental searching technique that exploits the properties of sorted arrays. Its efficiency makes it a preferred method for searching when working with large datasets. Understanding its underlying algorithm and being able to implement it in Python is a valuable skill in software engineering and data science."
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n",
       "│ <span style=\"color: #008000; text-decoration-color: #008000; font-weight: bold\">Getting response from llama3.2...</span>                                                                               │\n",
       "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n",
       "</pre>\n"
      ],
      "text/plain": [
       "╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮\n",
       "│ \u001b[1;32mGetting response from llama3.2...\u001b[0m                                                                               │\n",
       "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/markdown": [
       "## llama3.2 Response\n",
       "**Implementing Binary Search Algorithm in Python**\n",
       "=====================================================\n",
       "\n",
       "Binary search is an efficient algorithm for finding an item from a sorted list of items. It works by repeatedly dividing in half the portion of the list that could contain the item, until you've narrowed down the possible locations to just one.\n",
       "\n",
       "Here's a step-by-step guide on how to implement binary search in Python:\n",
       "\n",
       "**Step 1: Define the Search Function**\n",
       "-------------------------------------\n",
       "\n",
       "```python\n",
       "def binary_search(arr, target):\n",
       "    \"\"\"\n",
       "    Searches for an element in a sorted array using binary search algorithm.\n",
       "    \n",
       "    Parameters:\n",
       "    arr (list): The sorted list of elements.\n",
       "    target: The element to be searched.\n",
       "    \n",
       "    Returns:\n",
       "    int: The index of the target element if found; otherwise, -1.\n",
       "    \"\"\"\n",
       "```\n",
       "\n",
       "**Step 2: Initialize Variables**\n",
       "---------------------------------\n",
       "\n",
       "```python\n",
       "    low = 0  # Index of the first element in the list\n",
       "    high = len(arr) - 1  # Index of the last element in the list\n",
       "```\n",
       "\n",
       "**Step 3: Loop Until Found or Not Found**\n",
       "-----------------------------------------\n",
       "\n",
       "```python\n",
       "    while low <= high:\n",
       "        mid = (low + high) // 2  # Calculate the middle index\n",
       "        \n",
       "        if arr[mid] == target:\n",
       "            return mid  # Target found, return its index\n",
       "        \n",
       "        elif arr[mid] < target:\n",
       "            low = mid + 1  # Search in the right half\n",
       "            \n",
       "        else:\n",
       "            high = mid - 1  # Search in the left half\n",
       "```\n",
       "\n",
       "**Step 4: Handle Edge Cases**\n",
       "---------------------------\n",
       "\n",
       "```python\n",
       "    if low > high:\n",
       "        return -1  # Target not found, return -1\n",
       "```\n",
       "\n",
       "**Putting it all Together**\n",
       "-----------------------------\n",
       "\n",
       "Here's the complete binary search implementation in Python:\n",
       "\n",
       "```python\n",
       "def binary_search(arr, target):\n",
       "    \"\"\"\n",
       "    Searches for an element in a sorted array using binary search algorithm.\n",
       "    \n",
       "    Parameters:\n",
       "    arr (list): The sorted list of elements.\n",
       "    target: The element to be searched.\n",
       "    \n",
       "    Returns:\n",
       "    int: The index of the target element if found; otherwise, -1.\n",
       "    \"\"\"\n",
       "    low = 0\n",
       "    high = len(arr) - 1\n",
       "\n",
       "    while low <= high:\n",
       "        mid = (low + high) // 2\n",
       "        \n",
       "        if arr[mid] == target:\n",
       "            return mid\n",
       "        elif arr[mid] < target:\n",
       "            low = mid + 1\n",
       "        else:\n",
       "            high = mid - 1\n",
       "    \n",
       "    return -1\n",
       "\n",
       "# Example usage\n",
       "arr = [2, 4, 6, 8, 10]\n",
       "target = 6\n",
       "index = binary_search(arr, target)\n",
       "if index != -1:\n",
       "    print(f\"Target {target} found at index {index}\")\n",
       "else:\n",
       "    print(\"Target not found\")\n",
       "```\n",
       "\n",
       "**Time Complexity**\n",
       "------------------\n",
       "\n",
       "The time complexity of binary search is O(log n), where n is the length of the input array. This makes it much faster than linear search (O(n)) for large datasets.\n",
       "\n",
       "I hope this explanation helps! Let me know if you have any further questions or need additional clarification."
      ],
      "text/plain": [
       "<IPython.core.display.Markdown object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "\n",
       "        <div style=\"display: flex; width: 100%;\">\n",
       "            <div style=\"flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 5px; margin-right: 10px;\">\n",
       "                <h3 style=\"color: #4285F4;\">gpt-4o-mini</h3>\n",
       "                <div style=\"white-space: pre-wrap;\">Binary search is an efficient algorithm for finding a target value within a sorted list. It works by repeatedly dividing the search interval in half. If the target value is less than the element in the middle of the interval, the search continues on the lower half; otherwise, it continues on the upper half. This process is continued until the target value is found or the search interval is empty.\n",
       "\n",
       "Here's a detailed explanation and implementation of the binary search algorithm in Python:\n",
       "\n",
       "### Step-by-Step Implementation\n",
       "\n",
       "1. **Prerequisites**:\n",
       "   - Ensure the input list is sorted. Binary search can only be performed on a sorted list.\n",
       "  \n",
       "2. **Set Initial Variables**:\n",
       "   - Define two pointers, `low` and `high`, which represent the starting and ending indices of the search range in the list.\n",
       "\n",
       "3. **Calculate the Middle Index**:\n",
       "   - Use the formula `mid = (low + high) // 2` to find the middle index.\n",
       "\n",
       "4. **Comparison**:\n",
       "   - Compare the middle element with the target:\n",
       "     - If the middle element is equal to the target, return the index of the middle element.\n",
       "     - If the target is less than the middle element, narrow the search to the left half by setting `high = mid - 1`.\n",
       "     - If the target is greater than the middle element, narrow the search to the right half by setting `low = mid + 1`.\n",
       "\n",
       "5. **Loop Until the Target is Found or the Interval is Empty**:\n",
       "   - Repeat the above steps until the `low` pointer exceeds the `high` pointer. If the target is not found, return a value indicating that the target is not present (commonly -1).\n",
       "\n",
       "### Implementation in Python\n",
       "\n",
       "Here’s a complete Python implementation of the binary search algorithm:\n",
       "\n",
       "```python\n",
       "def binary_search(arr, target):\n",
       "    low = 0\n",
       "    high = len(arr) - 1\n",
       "\n",
       "    while low <= high:\n",
       "        # Find the middle index\n",
       "        mid = (low + high) // 2\n",
       "        \n",
       "        # Check if the target is present at mid\n",
       "        if arr[mid] == target:\n",
       "            return mid  # Target found, return the index\n",
       "        \n",
       "        # If the target is smaller than the mid element,\n",
       "        # it can only be present in the left subarray\n",
       "        elif arr[mid] > target:\n",
       "            high = mid - 1\n",
       "        \n",
       "        # If the target is larger than the mid element,\n",
       "        # it can only be present in the right subarray\n",
       "        else:\n",
       "            low = mid + 1\n",
       "\n",
       "    # Target was not found\n",
       "    return -1\n",
       "```\n",
       "\n",
       "### Example Usage\n",
       "\n",
       "```python\n",
       "# Example sorted list\n",
       "arr = [1, 3, 5, 7, 9, 11, 13, 15, 17, 19]\n",
       "target = 7\n",
       "\n",
       "# Perform binary search\n",
       "result = binary_search(arr, target)\n",
       "\n",
       "if result != -1:\n",
       "    print(f'Target {target} found at index {result}.')\n",
       "else:\n",
       "    print(f'Target {target} not found in the list.')\n",
       "```\n",
       "\n",
       "### Key Points\n",
       "\n",
       "1. **Time Complexity**: The time complexity of binary search is O(log n), where n is the number of elements in the array. This is significantly more efficient than a linear search, which has a time complexity of O(n).\n",
       "  \n",
       "2. **Space Complexity**: The space complexity of the binary search algorithm is O(1) for the iterative version, as it requires a fixed amount of space for variables.\n",
       "\n",
       "3. **Iterative vs Recursive**: The above implementation is iterative, which is generally preferred for binary search due to its efficiency and avoidance of recursion limits. However, a recursive implementation can also be done:\n",
       "\n",
       "### Recursive Implementation\n",
       "\n",
       "```python\n",
       "def binary_search_recursive(arr, target, low, high):\n",
       "    if low <= high:\n",
       "        mid = (low + high) // 2\n",
       "        \n",
       "        if arr[mid] == target:\n",
       "            return mid\n",
       "        elif arr[mid] > target:\n",
       "            return binary_search_recursive(arr, target, low, mid - 1)\n",
       "        else:\n",
       "            return binary_search_recursive(arr, target, mid + 1, high)\n",
       "    \n",
       "    return -1\n",
       "```\n",
       "\n",
       "### Conclusion\n",
       "\n",
       "Binary search is a fundamental searching technique that exploits the properties of sorted arrays. Its efficiency makes it a preferred method for searching when working with large datasets. Understanding its underlying algorithm and being able to implement it in Python is a valuable skill in software engineering and data science.</div>\n",
       "            </div>\n",
       "            <div style=\"flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 5px;\">\n",
       "                <h3 style=\"color: #34A853;\">llama3.2</h3>\n",
       "                <div style=\"white-space: pre-wrap;\">**Implementing Binary Search Algorithm in Python**\n",
       "=====================================================\n",
       "\n",
       "Binary search is an efficient algorithm for finding an item from a sorted list of items. It works by repeatedly dividing in half the portion of the list that could contain the item, until you've narrowed down the possible locations to just one.\n",
       "\n",
       "Here's a step-by-step guide on how to implement binary search in Python:\n",
       "\n",
       "**Step 1: Define the Search Function**\n",
       "-------------------------------------\n",
       "\n",
       "```python\n",
       "def binary_search(arr, target):\n",
       "    \"\"\"\n",
       "    Searches for an element in a sorted array using binary search algorithm.\n",
       "    \n",
       "    Parameters:\n",
       "    arr (list): The sorted list of elements.\n",
       "    target: The element to be searched.\n",
       "    \n",
       "    Returns:\n",
       "    int: The index of the target element if found; otherwise, -1.\n",
       "    \"\"\"\n",
       "```\n",
       "\n",
       "**Step 2: Initialize Variables**\n",
       "---------------------------------\n",
       "\n",
       "```python\n",
       "    low = 0  # Index of the first element in the list\n",
       "    high = len(arr) - 1  # Index of the last element in the list\n",
       "```\n",
       "\n",
       "**Step 3: Loop Until Found or Not Found**\n",
       "-----------------------------------------\n",
       "\n",
       "```python\n",
       "    while low <= high:\n",
       "        mid = (low + high) // 2  # Calculate the middle index\n",
       "        \n",
       "        if arr[mid] == target:\n",
       "            return mid  # Target found, return its index\n",
       "        \n",
       "        elif arr[mid] < target:\n",
       "            low = mid + 1  # Search in the right half\n",
       "            \n",
       "        else:\n",
       "            high = mid - 1  # Search in the left half\n",
       "```\n",
       "\n",
       "**Step 4: Handle Edge Cases**\n",
       "---------------------------\n",
       "\n",
       "```python\n",
       "    if low > high:\n",
       "        return -1  # Target not found, return -1\n",
       "```\n",
       "\n",
       "**Putting it all Together**\n",
       "-----------------------------\n",
       "\n",
       "Here's the complete binary search implementation in Python:\n",
       "\n",
       "```python\n",
       "def binary_search(arr, target):\n",
       "    \"\"\"\n",
       "    Searches for an element in a sorted array using binary search algorithm.\n",
       "    \n",
       "    Parameters:\n",
       "    arr (list): The sorted list of elements.\n",
       "    target: The element to be searched.\n",
       "    \n",
       "    Returns:\n",
       "    int: The index of the target element if found; otherwise, -1.\n",
       "    \"\"\"\n",
       "    low = 0\n",
       "    high = len(arr) - 1\n",
       "\n",
       "    while low <= high:\n",
       "        mid = (low + high) // 2\n",
       "        \n",
       "        if arr[mid] == target:\n",
       "            return mid\n",
       "        elif arr[mid] < target:\n",
       "            low = mid + 1\n",
       "        else:\n",
       "            high = mid - 1\n",
       "    \n",
       "    return -1\n",
       "\n",
       "# Example usage\n",
       "arr = [2, 4, 6, 8, 10]\n",
       "target = 6\n",
       "index = binary_search(arr, target)\n",
       "if index != -1:\n",
       "    print(f\"Target {target} found at index {index}\")\n",
       "else:\n",
       "    print(\"Target not found\")\n",
       "```\n",
       "\n",
       "**Time Complexity**\n",
       "------------------\n",
       "\n",
       "The time complexity of binary search is O(log n), where n is the length of the input array. This makes it much faster than linear search (O(n)) for large datasets.\n",
       "\n",
       "I hope this explanation helps! Let me know if you have any further questions or need additional clarification.</div>\n",
       "            </div>\n",
       "        </div>\n",
       "        "
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Define a new question\n",
    "new_question = \"Explain how to implement a binary search algorithm in Python.\"\n",
    "\n",
    "console.print(Panel(f\"[bold]New Question:[/bold]\\n{new_question}\", border_style=\"green\"))\n",
    "\n",
    "# Get responses for the new question\n",
    "new_responses = tutor.ask(new_question)\n",
    "\n",
    "# Compare responses\n",
    "tutor.compare_responses()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "dca14276-c3d5-493a-aa1f-8dc4c23b144d",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
